# Contributor: DaKnig <zannyknig@disroot.org>
# Maintainer: DaKnig <zannyknig@disroot.org>
pkgname=dewduct
pkgver=0.2.1
pkgrel=0
pkgdesc="A privacy-focused and mobile-friendly YouTube player, a NewPipe clone for GNOME, in Rust and GTK, based on Invidious"
source="$pkgname-$pkgver.zip::https://github.com/DaKnig/DewDuct/archive/refs/tags/v$pkgver.zip"
arch="all"
license="GPL-3.0-or-later"
depends="libadwaita mpv openssl yt-dlp"
makedepends="cargo-auditable libadwaita-dev openssl-dev rust"
url="https://github.com/DaKnig/DewDuct"
builddir="$srcdir/DewDuct-$pkgver"

_appid=null.daknig.dewduct

options="!check" # currently, no tests available.

prepare() {
        default_prepare
        cargo fetch --target="$CTARGET" --locked
}

build() {
	appstreamcli make-desktop-file data/"$_appid".metainfo.xml "$_appid".desktop
	cargo build --release --frozen
}

package() {
	install -D "$builddir"/target/release/"$pkgname" "$pkgdir"/usr/bin/"$pkgname"
	install -D "$builddir"/data/"$_appid".metainfo.xml -t "$pkgdir"/usr/share/metainfo/
	install -D "$_appid".desktop "$pkgdir"/usr/share/applications/"$_appid".desktop
}
sha512sums="
74a8c27029fa832fc07da40a5664844ddffeb5c83447135e3723ad35a80da5ed087773e1831699b136a8ca02e13d6e53fad9ac12a235152c58b11c5129425e09  dewduct-0.2.1.zip
"
